package cn.han.controller;


import JDBC.Connect1;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "Servlet01",urlPatterns = "/han.go")
public class Servlet01 extends HttpServlet {
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String[] usernames = request.getParameterValues("username");
        String[] passwords = request.getParameterValues("password");
//        System.out.println(passwords[0]);
//        System.out.println(usernames[0]);
        try {
            Connect1.InsertValue(usernames[0],passwords[0]);

        } catch (Exception e) {
            e.printStackTrace();
        }

//    }protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//
//    }

//    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//
//    }


    }
}
